﻿using System;
using System.IO;
//using System.Linq.Expressions;

using OpenCompiler.AST;
using OpenCompiler.Scanning;

namespace OpenCompiler
{
	public class Program
	{
		static void Main(string[] args)
		{
			var before = DateTime.Now;

			string filename;
			filename = @"C:\Projects\Nordea\Trunk\Objectware\Common\Service References\DispatcherService\Reference.cs";
			//filename = "c:\\main.cs";

			var ns = Statement.File(filename).Namespace("Test");
			var c = ns.Types.Class("MyClass").Public();
			var output = c.Method("MyMethod").Public();
			output = c.Method("MyOtherMethod").Private();


			var generated = output.Root.GenerateString();

			var root = output.Root;

			string input = File.ReadAllText(filename);

			var scanner = new Scanner(filename);
			var tokens = scanner.Tokenize(input);

			var parser = new Parser();
			parser.Parse(tokens);

			var after = DateTime.Now;

			Console.WriteLine("It took : "+after.Subtract(before));
		}
	}
}